<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <script src="./rx.min.js"></script>
    <title>Title</title>
</head>

<body>


</body>

<script>
// var clicks = Rx.Observable.fromEvent(document, 'click');
// var result = clicks.concatMapTo(Rx.Observable.interval(1000).take(4));
// result.subscribe(x => console.log(x));

// var clicks = Rx.Observable.fromEvent(document, 'click');
// var result = clicks.audit(ev => Rx.Observable.interval(1000));
// result.subscribe(x => console.log(x));

// var clicks = Rx.Observable.fromEvent(document, 'click');
// var higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4));
// var firstOrder = higherOrder.concatAll();
// firstOrder.subscribe(x => console.log(x));

var clicks = Rx.Observable.fromEvent(document, 'click');
var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));
result.subscribe(x => console.log(x));

</script>

</html>